﻿using System.Windows;
using System.Windows.Controls;
using BlueHarvestSnippetGenerator.Snippets.SnippetControl;
using DataContextLayer;
using ICSharpCode.AvalonEdit.Highlighting;

namespace BlueHarvestSnippetGenerator.Pages
{
    /// <summary>
    /// Interaction logic for Snippet.xaml
    /// </summary>
	
    public partial class SnippetPage : Page
    {

        private readonly SnipGen _snipGen;

        public IHighlightingDefinition TestTemp
        {
            get
            {
                switch (UserProfile.CurrentLanguage)
                {
                    case "Csharp":
                        return HighlightingManager.Instance.GetDefinition("C#");
              
                    case "Java":
                        return HighlightingManager.Instance.GetDefinition("Java");
                }

                return null;
            }
        }

        public SnippetPage()
        {
            InitializeComponent();

            _snipGen = new SnipGen();
        }


        private void PageLoaded(object sender, RoutedEventArgs e)
        {
            textEditor.SyntaxHighlighting = TestTemp;

            textEditor.AppendText(_snipGen.SnippetCode);
        }

        private void BtnSubmitClick(object sender, RoutedEventArgs e)
        {

            MessageBox.Show("lazy");


        }


        
    }
}
